Inside Macintosh: QuickTime Components

Previous | Chapter Top | Chapter Contents | Next

Clipping

Some video digitizer components can clip the output video image based on an arbitrary clipping region. Your application can determine whether a video digitizer component supports clipping by examining the digitizer information structure of the component. Specifically, if the digiOutDoesMask flag is set to 1 in the outputCapabilityFlags field of the appropriate digitizer information structure, the component supports clipping. See "The Digitizer Information Structure," for details. Your application can obtain a component's digitizer information structure by calling the VDGetDigitizerInfo function, which is described on VDGetDigitizerInfo . This section describes the functions provided to applications by components that support clipping.

Applications can use the VDSetClipState and VDGetClipState functions to enable and disable clipping, and to determine whether clipping is enabled. Applications can use the VDSetClipRgn and VDClearClipRgn functions to manipulate the clipping region. Applications can use these functions only during an active grab sequence. Applications set the initial clipping settings by calling either VDSetPlayThruDestination or VDSetPlayThruGlobalRect (described on VDSetPlayThruDestination and VDSetPlayThruGlobalRect , respectively).

The functions that manipulate clipping and clipping state operate on a clipping region in addition to the one specified by the mask passed by the VDSetPlayThruDestination and VDSetUpBuffers functions (described on VDSetPlayThruDestination and VDSetupBuffers , respectively). To determine the final clipping regions, intersect these two clippings.

VDSetClipRgn

The VDSetClipRgn function allows your application to define a clipping region.

pascal VideoDigitizerError VDSetClipRgn
                                         (VideoDigitizerComponent ci,
                                          RgnHandle clipRegion);
ci
Specifies the video digitizer component for the request. Applications obtain this reference from the Component Manager's OpenComponent function.
clipRegion
Specifies the clipping region.

DESCRIPTION

When clipping is enabled, the video digitizer component performs clipping in the region specified with this function.

RESULT CODES

noErr

0

No error

digiUnimpErr

-2201

Function not supported

SEE ALSO

Applications can disable all or part of a clipping region by calling the VDClearClipRgn function, described in the next section.

VDClearClipRgn

The VDClearClipRgn function allows your application to disable all or part of a clipping region that was previously set with the VDSetClipRgn function, which is described in the previous section.

pascal VideoDigitizerError VDClearClipRgn
                                         (VideoDigitizerComponent ci,
                                          RgnHandle clipRegion);
ci
Specifies the video digitizer component for the request. Applications obtain this reference from the Component Manager's OpenComponent function.
clipRegion
Specifies the clipping region to clear. This region must correspond to all or part of the clipping region established previously with the VDSetClipRgn function.

RESULT CODES

noErr

0

No error

digiUnimpErr

-2201

Function not supported

VDSetClipState

The VDSetClipState function allows applications to control whether clipping is enabled.

pascal VideoDigitizerError VDSetClipState
                                         (VideoDigitizerComponent ci,
                                         short clipEnable);
ci
Specifies the video digitizer component for the request. Applications obtain this reference from the Component Manager's OpenComponent function.
clipEnable
Controls whether clipping is enabled. Valid values are
0
Disable clipping
1
Enable clipping

RESULT CODES

noErr

0

No error

digiUnimpErr

-2201

Function not supported

SEE ALSO

Applications can determine whether clipping is enabled by calling the VDGetClipState function, which is described in the next section.

VDGetClipState

The VDGetClipState function allows applications to determine whether clipping is enabled.

pascal VideoDigitizerError VDGetClipState
                                         (VideoDigitizerComponent ci,
                                         short *clipEnable);
ci
Specifies the video digitizer component for the request. Applications obtain this reference from the Component Manager's OpenComponent function.
clipEnable
Contains a pointer to a field that is to receive a value indicating whether clipping is enabled. The video digitizer component places one of the following values into the field referred to by the clipEnable parameter:
0
Clipping disabled
1
Clipping enabled

RESULT CODES

noErr

0

No error

digiUnimpErr

-2201

Function not supported

SEE ALSO

Applications can enable and disable clipping by calling the VDSetClipState function, described in the previous section.


© 1997 Apple Computer, Inc.

Previous | Chapter Top | Chapter Contents | Next